﻿namespace PortableRiotGames.Interfaces.Summoner
{
    using Newtonsoft.Json;
    using PortableRiotGames.Infrastructure;
    using System.Collections.Generic;

    [JsonObject(MemberSerialization.OptIn)]
    public sealed class GetMasteriesResponse : ResponseBase
    {
        /// <summary>
        /// List of mastery pages associated with the summoner.
        /// </summary>
        [JsonProperty("pages")]
        public List<GetMasteriesResponseMasteryPage> Pages { get; set; }

        /// <summary>
        /// Summoner id associated with player.
        /// </summary>
        [JsonProperty("summonerId")]
        public long SummonerID { get; set; }
    }

    [JsonObject(MemberSerialization.OptIn)]
    public sealed class GetMasteriesResponseMasteryPage
    {
        /// <summary>
        /// Indicates if the mastery page is the current mastery page.
        /// </summary>
        [JsonProperty("current")]
        public bool Current { get; set; }

        /// <summary>
        /// Mastery page ID.
        /// </summary>
        [JsonProperty("id")]
        public string ID { get; set; }

        /// <summary>
        /// Mastery page name.
        /// </summary>
        [JsonProperty("name")]
        public string Name { get; set; }

        /// <summary>
        /// List of mastery page talents associated with the mastery page.
        /// </summary>
        [JsonProperty("talents")]
        public List<GetMasteriesResponseTalent> Talents { get; set; }
    }

    [JsonObject(MemberSerialization.OptIn)]
    public sealed class GetMasteriesResponseTalent
    {
        /// <summary>
        /// Talent ID.
        /// </summary>
        [JsonProperty("id")]
        public int ID { get; set; }

        /// <summary>
        /// Talent name.
        /// </summary>
        [JsonProperty("name")]
        public string Name { get; set; }

        /// <summary>
        /// Talent rank.
        /// </summary>
        [JsonProperty("rank")]
        public int Rank { get; set; }
    }
}